Many conventional programs retrieve files over the Internet. To save the time of retrieval of the same file over and over again, many computer systems store the files they retrieve into a cache, and subsequent retrievals are first attempted from the cache. When a system employs a cache, if the computer system receives a request for a file, it first checks the cache. If the file is in the cache, the computer system retrieves the file from the cache. Because the retrieval of a file from a local hard drive can be much faster than retrieving the file from the Internet or other network, the retrieval of the file from the cache can significantly speed the retrieval of a file. If the file is not in the cache, the file is retrieved from the Internet.
However, conventional caching systems are neither secure nor precise. If the requested file has been corrupted, by a malicious party for example, the cache may not detect the corruption and will supply the file. If a new version of the file is available with the same name, the caching system will not distinguish the versions and can supply the older version.
Some conventional browsers attempt to resolve this problem by only retrieving files from a cache if the file was originally retrieved from the same Internet domain as the file or program corresponding to the source of the request. Although this can help prevent the problems of corruption or version incompatibility, it results in slower download times because files in the cache are downloaded again. It also does not detect the corruption of a file or an incorrect version.
What is needed is a system and method for caching files that supply files from a cache having an original source of any domain, but can detect the corruption or the storage of an incorrect version of the file in the cache and supply the uncorrupt file or requested version, even if another version having the same file name is stored in the cache.